3.16 \(\int \csc (c+d x) (a+b \tan (c+d x)) \, dx\)

Optimal. Leaf size=26 \[ \frac {b \tanh ^{-1}(\sin (c+d x))}{d}-\frac {a \tanh ^{-1}(\cos (c+d x))}{d} \]

[Out]

-a*arctanh(cos(d*x+c))/d+b*arctanh(sin(d*x+c))/d

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 26, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 2, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {3517, 3770} \[ \frac {b \tanh ^{-1}(\sin (c+d x))}{d}-\frac {a \tanh ^{-1}(\cos (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Int[Csc[c + d*x]*(a + b*Tan[c + d*x]),x]

[Out]

-((a*ArcTanh[Cos[c + d*x]])/d) + (b*ArcTanh[Sin[c + d*x]])/d

Rule 3517

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Int[Expand[Sin[e
+ f*x]^m*(a + b*Tan[e + f*x])^n, x], x] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] && IGtQ[n, 0]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin {align*} \int \csc (c+d x) (a+b \tan (c+d x)) \, dx &=\int (a \csc (c+d x)+b \sec (c+d x)) \, dx\\ &=a \int \csc (c+d x) \, dx+b \int \sec (c+d x) \, dx\\ &=-\frac {a \tanh ^{-1}(\cos (c+d x))}{d}+\frac {b \tanh ^{-1}(\sin (c+d x))}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 52, normalized size = 2.00 \[ \frac {a \log \left (\sin \left (\frac {c}{2}+\frac {d x}{2}\right )\right )}{d}-\frac {a \log \left (\cos \left (\frac {c}{2}+\frac {d x}{2}\right )\right )}{d}+\frac {b \tanh ^{-1}(\sin (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[Csc[c + d*x]*(a + b*Tan[c + d*x]),x]

[Out]

(b*ArcTanh[Sin[c + d*x]])/d - (a*Log[Cos[c/2 + (d*x)/2]])/d + (a*Log[Sin[c/2 + (d*x)/2]])/d

________________________________________________________________________________________

fricas [B]  time = 0.52, size = 58, normalized size = 2.23 \[ -\frac {a \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - a \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - b \log \left (\sin \left (d x + c\right ) + 1\right ) + b \log \left (-\sin \left (d x + c\right ) + 1\right )}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)*(a+b*tan(d*x+c)),x, algorithm="fricas")

[Out]

-1/2*(a*log(1/2*cos(d*x + c) + 1/2) - a*log(-1/2*cos(d*x + c) + 1/2) - b*log(sin(d*x + c) + 1) + b*log(-sin(d*
x + c) + 1))/d

________________________________________________________________________________________

giac [A]  time = 0.49, size = 49, normalized size = 1.88 \[ \frac {b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)*(a+b*tan(d*x+c)),x, algorithm="giac")

[Out]

(b*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - b*log(abs(tan(1/2*d*x + 1/2*c) - 1)) + a*log(abs(tan(1/2*d*x + 1/2*c))
))/d

________________________________________________________________________________________

maple [A]  time = 0.28, size = 42, normalized size = 1.62 \[ \frac {b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {a \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(d*x+c)*(a+b*tan(d*x+c)),x)

[Out]

1/d*b*ln(sec(d*x+c)+tan(d*x+c))+1/d*a*ln(csc(d*x+c)-cot(d*x+c))

________________________________________________________________________________________

maxima [A]  time = 0.54, size = 46, normalized size = 1.77 \[ \frac {b {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 2 \, a \log \left (\cot \left (d x + c\right ) + \csc \left (d x + c\right )\right )}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)*(a+b*tan(d*x+c)),x, algorithm="maxima")

[Out]

1/2*(b*(log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1)) - 2*a*log(cot(d*x + c) + csc(d*x + c)))/d

________________________________________________________________________________________

mupad [B]  time = 3.75, size = 86, normalized size = 3.31 \[ \frac {a\,\ln \left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}-\frac {2\,b\,\mathrm {atanh}\left (\frac {b\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )-a\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{a\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )-b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*tan(c + d*x))/sin(c + d*x),x)

[Out]

(a*log(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d - (2*b*atanh((b*cos(c/2 + (d*x)/2) - a*sin(c/2 + (d*x)/2))/(a
*cos(c/2 + (d*x)/2) - b*sin(c/2 + (d*x)/2))))/d

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \tan {\left (c + d x \right )}\right ) \csc {\left (c + d x \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)*(a+b*tan(d*x+c)),x)

[Out]

Integral((a + b*tan(c + d*x))*csc(c + d*x), x)

________________________________________________________________________________________